<?php session_start();
if(!isset($_SESSION["username"]))
{
    header("Location:workerlogin.html");
}
else {
    date_default_timezone_set("Asia/Shanghai");
    @$date=date('l jS \of F Y \a\t h:i:s A');
    $username=$_SESSION['username'];
    @$id=$_REQUEST['id'];
    @$code=$_REQUEST['code'];
    @$actual_code=$_REQUEST['actual_code'];
    $a=mysqli_connect("localhost", "root", "deng123", "housekeeping", "3306") or die("unable to connect");

    if ($id!=null)
    {
        if ($code==$actual_code)
        {
            @$query="select * from renovation_bookings where id='$id'";
            @$result = mysqli_query($a, $query);
            if ($result)
            {
                while ($row=mysqli_fetch_array($result))
                {
                    $code_verified=$row['code_verified'];
                    $worker_cost=$row['worker_cost'];
                    $web_cost=$row['web_cost'];
                    $total=$row['total'];
                    $pay_method=$row['pay_method'];
                    $worker_card_no=$row['worker_card_no'];
                    $user_card_no=$row['user_card_no'];
                    $admin_card_no=$row['admin_card_no'];
                }
                if ($code_verified=='Not yet')
                {
                    if ($pay_method=='银行卡')
                    {
                        @$q1="select Amount from credit_card where card_no='$user_card_no'";
                        @$r1 = mysqli_query($a, $q1);
                        if ($r1)
                        {
                            while ($row=mysqli_fetch_array($r1))
                            {
                                $user_amount=$row['Amount'];
                            }
                            if ($user_amount>=$total)
                            {
                                $user_amount=$user_amount-$total;
                                @$q2="update credit_card set Amount='$user_amount' where card_no='$user_card_no'";
                                @$r2 = mysqli_query($a, $q2);
                                if ($r2)
                                {
                                    @$q3="select Amount from credit_card where card_no='$worker_card_no'";
                                    @$r3 = mysqli_query($a, $q3);
                                    if ($r3)
                                    {
                                        while ($row=mysqli_fetch_array($r3))
                                        {
                                            $worker_amount=$row['Amount'];
                                        }
                                        $worker_amount=$worker_amount+$worker_cost;
                                        @$q4="update credit_card set Amount='$worker_amount' where card_no='$worker_card_no'";
                                        @$r4 = mysqli_query($a, $q4);
                                        if ($r4)
                                        {
                                            @$q5="select Amount from credit_card where card_no='$admin_card_no'";
                                            @$r5 = mysqli_query($a, $q5);
                                            if ($r5)
                                            {
                                                while ($row=mysqli_fetch_array($r5))
                                                {
                                                    $admin_amount=$row['Amount'];
                                                }
                                                $admin_amount=$admin_amount+$web_cost;
                                                @$q6="update credit_card set Amount='$admin_amount' where card_no='$admin_card_no'";
                                                @$r6 = mysqli_query($a, $q6);
                                                if ($r6)
                                                {
                                                    @$q7="update renovation_bookings set code_verified='Yes',worker_pay_received='Yes',website_pay_received='Yes',actual_work_start_time='$date' where id='$id'";
                                                    @$r7 = mysqli_query($a, $q7);
                                                    if ($r7)
                                                    {
                                                        ?>
                                                        <!DOCTYPE html>
                                                        <html lang="en">

                                                        <head>
                                                            <!-- Required meta tags-->
                                                            <meta charset="utf-8">
                                                            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
                                                            <meta name="description" content="">
                                                            <meta name="author" content="">
                                                            <meta name="viewport" content="width=device-width, initial-scale=1">
                                                            <title>好先生 | 家政服务</title>
                                                            <link rel="shortcut icon" href="img/favicon.ico"/>
                                                            <!-- Icons font CSS-->
                                                            <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                                                            <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
                                                            <link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">
                                                            <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
                                                            <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900"
                                                                  rel="stylesheet">
                                                            <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
                                                            <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
                                                            <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">

                                                            <!-- Font special for pages-->
                                                            <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"
                                                                  rel="stylesheet">

                                                            <!-- Vendor CSS-->
                                                            <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
                                                            <link href="css/hover-min.css" rel="stylesheet">


                                                            <!-- Main CSS-->
                                                            <link href="css/style.css" rel="stylesheet" media="all">
                                                            <link href="css/main.css" rel="stylesheet" media="all">
                                                        </head>

                                                        <body>
                                                        <nav class="navbar navbar-expand-lg navbar-light fixed-top"
                                                             style="background:-webkit-gradient(linear, right top, left top, from(#1da1f2), to(#005f7f));" id="mainNav">
                                                            <div class="container">
                                                                <div class="navbar-header">
                                                                    <a class=" nav-link js-scroll-trigger" href="#top">
                                                                        <img class="img-rounded" src="img/logo.png"/>
                                                                    </a>
                                                                </div>
                                                                &nbsp;
                                                                <a class="navbar-brand " href="#page-top">
                                                                    <h2>
                                                                        <small style="font-family: Arial;border-bottom: 2px solid gainsboro"><?php echo $_SESSION['name']; ?></small>
                                                                    </h2>
                                                                </a>
                                                                <button class="navbar-toggler navbar-toggler-right ml-auto" type="button" data-toggle="collapse"
                                                                        data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
                                                                        aria-label="Toggle navigation">
                                                                    菜单
                                                                    <i class="fas fa-bars"></i>
                                                                </button>
                                                                <div class="collapse navbar-collapse" id="navbarResponsive">
                                                                    <ul class="navbar-nav ml-auto">
                                                                        <li class="nav-item">
                                                                            <a class="nav-link js-scroll-trigger hvr-glow" href="worker_profile.php">员工档案</a>
                                                                        </li>
                                                                        <li class="nav-item">
                                                                            <a class="nav-link js-scroll-trigger hvr-glow " href="worker_service.php">服务记录</a>
                                                                        </li>
                                                                        <li class="nav-item">
                                                                            <a class="nav-link js-scroll-trigger hvr-glow " href="worker_help.php">帮助</a>
                                                                        </li>
                                                                        <li class="nav-item">
                                                                            <a class="nav-link js-scroll-trigger hvr-glow " href="w_logout.php">退出</a>
                                                                        </li>
                                                                    </ul>
                                                                </div>
                                                            </div>
                                                        </nav>
                                                        <section class="features" id="features" style="background: url(img/bg-pattern.png), -webkit-linear-gradient(left, #6f42c1, #e4606d);"><br><br>
                                                            <div class="container">
                                                                <center><h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: yellow">Congrats!Code is verified.</h2><br>
                                                                    <h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: white"><i class="fa fa-arrow-right"></i>Your work is started now.</h2>
                                                                    <h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: white"><i class="fa fa-arrow-right"></i>Payment is credited to your account</h2></center><br>
                                                                <div class="col-sm-12 col-md-12 my-auto">
                                                                    <div class="container-fluid">
                                                                        <div class="row">
                                                                            <div class="col-md-4"></div>
                                                                            <div class="col-md-4">
                                                                                <br><br><br>
                                                                            </div>
                                                                            <div class="col-md-4">
                                                                            </div>
                                                                        </div><br><center style="color: lightgrey"><br>
                                                                        </center>
                                                        </section>
                                                        <!-- Jquery JS-->
                                                        <script src="vendor/jquery1/jquery.min.js"></script>
                                                        <!-- Vendor JS-->
                                                        <script src="vendor/select2/select2.min.js"></script>
                                                        <script src="vendor/jquery-validate/jquery.validate.min.js"></script>
                                                        <script src="vendor/bootstrap-wizard/bootstrap.min.js"></script>
                                                        <script src="vendor/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
                                                        <script src="vendor/jquery/jquery.min.js"></script>
                                                        <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
                                                        <script src="js/jquery_date_time_picker.js"></script>
                                                        <script src="js/jquery_date_time_picker1.js"></script>
                                                        <!-- Plugin JavaScript -->
                                                        <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

                                                        
                                                        <script src="js/new-age.min.js"></script>

                                                        <!-- Main JS-->
                                                        <script src="js/global.js"></script>
                                                        <footer>
                                                            <div class="container">
                                                                <p>&copy; 好先生 家政服务. 版权所有.</p>
                                                                <ul class="list-inline">
                                                                    <li class="list-inline-item">
                                                                        <a href="#">隐私</a>
                                                                    </li>
                                                                    <li class="list-inline-item">
                                                                        <a href="#">条款</a>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </footer>
                                                        </body>

                                                        </html>
                                                        <!-- end document-->
                                                        <?php
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                @$q1="update renovation_bookings set code_verified='Yes',booking_request='Cancelled due to insufficient balance' where id='$id'";
                                @$r1 = mysqli_query($a, $q1);
                                if ($r1)
                                {
                                    ?>
                                    <!DOCTYPE html>
                                    <html lang="en">

                                    <head>
                                        <!-- Required meta tags-->
                                        <meta charset="utf-8">
                                        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
                                        <meta name="description" content="">
                                        <meta name="author" content="">
                                        <meta name="viewport" content="width=device-width, initial-scale=1">
                                        <title>好先生 | 家政服务</title>
                                        <link rel="shortcut icon" href="img/favicon.ico"/>
                                        <!-- Icons font CSS-->
                                        <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                                        <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
                                        <link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">
                                        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
                                        <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900"
                                              rel="stylesheet">
                                        <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
                                        <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
                                        <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">

                                        <!-- Font special for pages-->
                                        <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"
                                              rel="stylesheet">

                                        <!-- Vendor CSS-->
                                        <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
                                        <link href="css/hover-min.css" rel="stylesheet">


                                        <!-- Main CSS-->
                                        <link href="css/style.css" rel="stylesheet" media="all">
                                        <link href="css/main.css" rel="stylesheet" media="all">
                                    </head>

                                    <body>
                                    <nav class="navbar navbar-expand-lg navbar-light fixed-top"
                                         style="background:-webkit-gradient(linear, right top, left top, from(#1da1f2), to(#005f7f));" id="mainNav">
                                        <div class="container">
                                            <div class="navbar-header">
                                                <a class=" nav-link js-scroll-trigger" href="#top">
                                                    <img class="img-rounded" src="img/logo.png"/>
                                                </a>
                                            </div>
                                            &nbsp;
                                            <a class="navbar-brand " href="#page-top">
                                                <h2>
                                                    <small style="font-family: Arial;border-bottom: 2px solid gainsboro"><?php echo $_SESSION['name']; ?></small>
                                                </h2>
                                            </a>
                                            <button class="navbar-toggler navbar-toggler-right ml-auto" type="button" data-toggle="collapse"
                                                    data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
                                                    aria-label="Toggle navigation">
                                                菜单
                                                <i class="fas fa-bars"></i>
                                            </button>
                                            <div class="collapse navbar-collapse" id="navbarResponsive">
                                                <ul class="navbar-nav ml-auto">
                                                    <li class="nav-item">
                                                        <a class="nav-link js-scroll-trigger hvr-glow" href="worker_profile.php">员工档案</a>
                                                    </li>
                                                    <li class="nav-item">
                                                        <a class="nav-link js-scroll-trigger hvr-glow " href="worker_service.php">服务记录</a>
                                                    </li>
                                                    <li class="nav-item">
                                                        <a class="nav-link js-scroll-trigger hvr-glow " href="worker_help.php">帮助</a>
                                                    </li>
                                                    <li class="nav-item">
                                                        <a class="nav-link js-scroll-trigger hvr-glow " href="w_logout.php">退出</a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </nav>
                                    <section class="features" id="features" style="background: url(img/bg-pattern.png), -webkit-linear-gradient(left, #6f42c1, #e4606d);"><br><br>
                                        <div class="container">
                                            <center><h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: yellow">Code is verified.</h2><br>
                                                <h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: white"><i class="fa fa-arrow-right"></i>But customer has insufficient balance</h2>
                                                <br>
                                                <div class="col-sm-12 col-md-12 my-auto">
                                                    <div class="container-fluid">
                                                        <div class="row">
                                                            <div class="col-md-4"></div>
                                                            <div class="col-md-4">
                                                            </div>
                                                            <div class="col-md-4">
                                                            </div>
                                                        </div><br><center style="color: lightgrey">
                                                            <h2>Work is cancelled.</h2><br><br><br><br>
                                                        </center>
                                    </section>
                                    <!-- Jquery JS-->
                                    <script src="vendor/jquery1/jquery.min.js"></script>
                                    <!-- Vendor JS-->
                                    <script src="vendor/select2/select2.min.js"></script>
                                    <script src="vendor/jquery-validate/jquery.validate.min.js"></script>
                                    <script src="vendor/bootstrap-wizard/bootstrap.min.js"></script>
                                    <script src="vendor/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
                                    <script src="vendor/jquery/jquery.min.js"></script>
                                    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
                                    <script src="js/jquery_date_time_picker.js"></script>
                                    <script src="js/jquery_date_time_picker1.js"></script>
                                    <!-- Plugin JavaScript -->
                                    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

                                    
                                    <script src="js/new-age.min.js"></script>

                                    <!-- Main JS-->
                                    <script src="js/global.js"></script>
                                    <footer>
                                        <div class="container">
                                            <p>&copy; 好先生 家政服务. 版权所有.</p>
                                            <ul class="list-inline">
                                                <li class="list-inline-item">
                                                    <a href="#">隐私</a>
                                                </li>
                                                <li class="list-inline-item">
                                                    <a href="#">条款</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </footer>
                                    </body>

                                    </html>
                                    <!-- end document-->
                                    <?php
                                }
                            }
                        }
                    }
                    else
                    {
                        @$q7="update renovation_bookings set code_verified='Yes',actual_work_start_time='$date' where id='$id'";
                        @$r7 = mysqli_query($a, $q7);
                        if ($r7)
                        {
                            ?>
                            <!DOCTYPE html>
                            <html lang="en">

                            <head>
                                <!-- Required meta tags-->
                                <meta charset="utf-8">
                                <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
                                <meta name="description" content="">
                                <meta name="author" content="">
                                <meta name="viewport" content="width=device-width, initial-scale=1">
                                <title>好先生 | 家政服务</title>
                                <link rel="shortcut icon" href="img/favicon.ico"/>
                                <!-- Icons font CSS-->
                                <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                                <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
                                <link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">
                                <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
                                <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900"
                                      rel="stylesheet">
                                <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
                                <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
                                <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">

                                <!-- Font special for pages-->
                                <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"
                                      rel="stylesheet">

                                <!-- Vendor CSS-->
                                <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
                                <link href="css/hover-min.css" rel="stylesheet">


                                <!-- Main CSS-->
                                <link href="css/style.css" rel="stylesheet" media="all">
                                <link href="css/main.css" rel="stylesheet" media="all">
                            </head>

                            <body>
                            <nav class="navbar navbar-expand-lg navbar-light fixed-top"
                                 style="background:-webkit-gradient(linear, right top, left top, from(#1da1f2), to(#005f7f));" id="mainNav">
                                <div class="container">
                                    <div class="navbar-header">
                                        <a class=" nav-link js-scroll-trigger" href="#top">
                                            <img class="img-rounded" src="img/logo.png"/>
                                        </a>
                                    </div>
                                    &nbsp;
                                    <a class="navbar-brand " href="#page-top">
                                        <h2>
                                            <small style="font-family: Arial;border-bottom: 2px solid gainsboro"><?php echo $_SESSION['name']; ?></small>
                                        </h2>
                                    </a>
                                    <button class="navbar-toggler navbar-toggler-right ml-auto" type="button" data-toggle="collapse"
                                            data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
                                            aria-label="Toggle navigation">
                                        菜单
                                        <i class="fas fa-bars"></i>
                                    </button>
                                    <div class="collapse navbar-collapse" id="navbarResponsive">
                                        <ul class="navbar-nav ml-auto">
                                            <li class="nav-item">
                                                <a class="nav-link js-scroll-trigger hvr-glow" href="worker_profile.php">员工档案</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link js-scroll-trigger hvr-glow " href="worker_service.php">服务记录</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link js-scroll-trigger hvr-glow " href="worker_help.php">帮助</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link js-scroll-trigger hvr-glow " href="w_logout.php">退出</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </nav>
                            <section class="features" id="features" style="background: url(img/bg-pattern.png), -webkit-linear-gradient(left, #6f42c1, #e4606d);"><br><br>
                                <div class="container">
                                    <center><h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: yellow">Congrats!Code is verified.</h2><br>
                                        <h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: white"><i class="fa fa-arrow-right"></i>Your work is started now.</h2>
                                        <br>
                                        <div class="col-sm-12 col-md-12 my-auto">
                                            <div class="container-fluid">
                                                <div class="row">
                                                    <div class="col-md-4"></div>
                                                    <div class="col-md-4">
                                                        <br><br><br>
                                                    </div>
                                                    <div class="col-md-4">
                                                    </div>
                                                </div><br><center style="color: lightgrey"><br><br><br>
                                                </center>
                            </section>
                            <!-- Jquery JS-->
                            <script src="vendor/jquery1/jquery.min.js"></script>
                            <!-- Vendor JS-->
                            <script src="vendor/select2/select2.min.js"></script>
                            <script src="vendor/jquery-validate/jquery.validate.min.js"></script>
                            <script src="vendor/bootstrap-wizard/bootstrap.min.js"></script>
                            <script src="vendor/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
                            <script src="vendor/jquery/jquery.min.js"></script>
                            <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
                            <script src="js/jquery_date_time_picker.js"></script>
                            <script src="js/jquery_date_time_picker1.js"></script>
                            <!-- Plugin JavaScript -->
                            <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

                            
                            <script src="js/new-age.min.js"></script>

                            <!-- Main JS-->
                            <script src="js/global.js"></script>
                            <footer>
                                <div class="container">
                                    <p>&copy; 好先生 家政服务. 版权所有.</p>
                                    <ul class="list-inline">
                                        <li class="list-inline-item">
                                            <a href="#">隐私</a>
                                        </li>
                                        <li class="list-inline-item">
                                            <a href="#">条款</a>
                                        </li>
                                    </ul>
                                </div>
                            </footer>
                            </body>

                            </html>
                            <!-- end document-->
                            <?php
                        }
                    }
                }
                else
                {
                    header("Location:worker_upcoming.php");
                }
            }
        }
        else
        {
            ?>
            <!DOCTYPE html>
            <html lang="en">

            <head>
                <!-- Required meta tags-->
                <meta charset="utf-8">
                <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
                <meta name="description" content="">
                <meta name="author" content="">
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <title>好先生 | 家政服务</title>
                <link rel="shortcut icon" href="img/favicon.ico"/>
                <!-- Icons font CSS-->
                <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
                <link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">
                <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
                <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900"
                      rel="stylesheet">
                <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
                <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
                <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">

                <!-- Font special for pages-->
                <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"
                      rel="stylesheet">

                <!-- Vendor CSS-->
                <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
                <link href="css/hover-min.css" rel="stylesheet">


                <!-- Main CSS-->
                <link href="css/style.css" rel="stylesheet" media="all">
                <link href="css/main.css" rel="stylesheet" media="all">
            </head>

            <body>
            <nav class="navbar navbar-expand-lg navbar-light fixed-top"
                 style="background:-webkit-gradient(linear, right top, left top, from(#1da1f2), to(#005f7f));" id="mainNav">
                <div class="container">
                    <div class="navbar-header">
                        <a class=" nav-link js-scroll-trigger" href="#top">
                            <img class="img-rounded" src="img/logo.png"/>
                        </a>
                    </div>
                    &nbsp;
                    <a class="navbar-brand " href="#page-top">
                        <h2>
                            <small style="font-family: Arial;border-bottom: 2px solid gainsboro"><?php echo $_SESSION['name']; ?></small>
                        </h2>
                    </a>
                    <button class="navbar-toggler navbar-toggler-right ml-auto" type="button" data-toggle="collapse"
                            data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
                            aria-label="Toggle navigation">
                        菜单
                        <i class="fas fa-bars"></i>
                    </button>
                    <div class="collapse navbar-collapse" id="navbarResponsive">
                        <ul class="navbar-nav ml-auto">
                            <li class="nav-item">
                                <a class="nav-link js-scroll-trigger hvr-glow" href="worker_profile.php">员工档案</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link js-scroll-trigger hvr-glow " href="worker_service.php">服务记录</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link js-scroll-trigger hvr-glow " href="worker_help.php">帮助</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link js-scroll-trigger hvr-glow " href="w_logout.php">退出</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            <section class="features" id="features" style="background: url(img/bg-pattern.png), -webkit-linear-gradient(left, #6f42c1, #e4606d);"><br><br>
                <div class="container">
                    <center><h2 style="font-family: 'Bradley Hand ITC';font-weight: bold;color: yellow">Incorrect code! Give the correct security code to start your work.</h2></center><br>
                    <div class="col-sm-12 col-md-12 my-auto">
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-4"></div>
                                <div class="col-md-4">
                                    <div class="feature-item" style="text-align:left;padding-left:15px;padding-right:15px;margin-top: 10px;border-radius: 10px;background: rgba(0,0,0,.6);">
                                        <div class="loginBox2">
                                            <center><h3 class="text-white">Enter the Code</h3><br></center>
                                            <form action="code_verify_renovation.php" method="post">
                                                <input style="padding: 5px" type="text" name="code" required>
                                                <input type="hidden" name="actual_code" value="<?php echo $actual_code; ?>">
                                                <input type="hidden" name="id" value="<?php echo $id; ?>">
                                                <br><br>
                                                <input class="btn" style="background-color: deeppink;color: white" type="submit" name="" value="Submit">
                                            </form>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                </div>
                            </div><br><center style="color: lightgrey"><br>
                                <h3>注意: Tell your customer to check <b class="btn" style="border-color: whitesmoke;color: whitesmoke">记录 <i class="fa fa-arrow-right"></i> 持续服务</b> section to get the code.</h3>
                            </center>
            </section>
            <!-- Jquery JS-->
            <script src="vendor/jquery1/jquery.min.js"></script>
            <!-- Vendor JS-->
            <script src="vendor/select2/select2.min.js"></script>
            <script src="vendor/jquery-validate/jquery.validate.min.js"></script>
            <script src="vendor/bootstrap-wizard/bootstrap.min.js"></script>
            <script src="vendor/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
            <script src="vendor/jquery/jquery.min.js"></script>
            <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
            <script src="js/jquery_date_time_picker.js"></script>
            <script src="js/jquery_date_time_picker1.js"></script>
            <!-- Plugin JavaScript -->
            <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

            
            <script src="js/new-age.min.js"></script>

            <!-- Main JS-->
            <script src="js/global.js"></script>
            <footer>
                <div class="container">
                    <p>&copy; 好先生 家政服务. 版权所有.</p>
                    <ul class="list-inline">
                        <li class="list-inline-item">
                            <a href="#">隐私</a>
                        </li>
                        <li class="list-inline-item">
                            <a href="#">条款</a>
                        </li>
                    </ul>
                </div>
            </footer>
            </body>

            </html>
            <!-- end document-->
            <?php
        }
    }
    else
    {
        header("Location:worker_upcoming.php");
    }
}
?>